package com.ruoyi.StarStudio.MQTT;

import com.ruoyi.StarStudio.Mapper.MeteorologyMapper;
import com.ruoyi.StarStudio.Service.Impl.MeteorologyServiceImpl;
import com.ruoyi.StarStudio.Service.Impl.SoilServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class DAO_Action implements CommandLineRunner{

    @Autowired
    SoilServiceImpl soilServiceImpl;

    @Autowired
    private MeteorologyServiceImpl meteorologyServiceImpl;

    /**
     * SpringBoot启动完成后执行
     * @param args
     * @throws Exception
     */
    @Override
    public void run(String... args) throws Exception {
        soilServiceImpl.SensorAdd();
        meteorologyServiceImpl.SensorAdd();
    }
}
